/****************************************************************************************************
		
		Replication file for:

		stata output
		Last update date: 29th August 2021
		
****************************************************************************************************/

****************************************************************************************************/

cd "D:\Essex_PhD\3rd_year\Data for R&R\Replication_R1\Appendix\Recursive Bivariate Probit Model"
clear
use "osv_onset.dta"



**************************************************************************************************
***** CONTROL VARIABLES *****
*****************************************************************************************************

global X1 lncapdist lnbdist ttime_mean lnpop mountains_mean prec_gpcp imr_mean conflict_intensity
global X2 spatial_lag_pko spatial_lag_osv
global X3 pyr  pyr2 pyr3
global X4 cyr  cyr2 cyr3


***************************************************************************************
* Recursive bivariat probit model  biprobit (Y2 = X1 X2 X3) (Y1 = Y2 X1 X2), robust
***************************************************************************************
clear
use "osv_onset.dta"
sort gid year

global X1 lncapdist lnbdist ttime_mean lnpop mountains_mean prec_gpcp imr_mean conflict_intensity
global X2 spatial_lag_pko spatial_lag_osv
global X3 pyr  pyr2 pyr3
global X4 cyr  cyr2 cyr3

* ModelA2.1*
biprobit (treat_aid = aid_instrument displacement $X1 $X2 $X3  ) (osv_binary = treat_pko treat_aid treat_aid##treat_pko $X1 $X2 $X3), nolog cl(gid)
outreg using model1.doc, se var starlevels(10 5 1) sigsymbols(+,*,**) note (Robust standard errors in parentheses clustered on cell.) replace

clear
use "osv_dur.dta"
sort gid year

global X1 lncapdist lnbdist ttime_mean lnpop mountains_mean prec_gpcp imr_mean lag_brd
global X2 spatial_lag_pko spatial_lag_osv
global X3 pyr  pyr2 pyr3
global X4 cyr  cyr2 cyr3

* ModelA2.2*
biprobit (treat_aid = aid_instrument displacement $X1 $X2 $X4  ) (osv_binary = treat_pko treat_aid treat_aid##treat_pko $X1 $X2 $X4), nolog cl(gid)
outreg using model2.doc, se var starlevels(10 5 1) sigsymbols(+,*,**) note (Robust standard errors in parentheses clustered on cell.) replace



